*** This do file creates the database for  												*/
*** FDI and UNHRCC																		*/
*** Krishna Chaitanya Vadlamannati(NTNU, Trondheim) 									*/
*** Nicole Jenz (Nottingham University, UK)												*/
*** �yvind Isachsen Berntsen(NTNU, Trondheim) 											*/
*****************************************************************************************
*** Last update: January 10, 2017
*****************************************************************************************
/* Note: This do file contains three parts: 											*/
/* 1) Preparation of data file															*/
/* 2) Data Manipulation		  															*/
/* 3) Regression Analysis 																*/
/* Change local CIA to the directory where you store the raw data						*/
/* Running the do file creates the transformed data in the file "Master"				*/
/* The corresponding output tables are saved in the new folder "tables"					*/
/* The output tables are saved into excel using "outreg2" command						*/
*****************************************************************************************

set more off 

******************************** Provide labels ********************************************

label var imfprogram 	"IMF Program (dummy)"
label var unchrtarget 	"UNCHR Target (dummy)"
label var unchrcondem 	"UNCHR Condemn (dummy)"
label var pcgdp 		"Per Capita GDP"
label var oecdhigh 		"OECD High Income (dummy)"
label var trade 		"Trade/GDP"
label var crisis 		"Crisis (dummy)"
label var conflict 		"Conflict (dummy)"
label var rentsgdp 		"Natural Resource Rents As Share of GDP"
label var polity 		"Polity Index (-10 - +10)"
label var democracy		"Democracy (1 if polity > +6, else 0)"
label var autocracy		"Autocracy (1 if polity < -5, else 0)"
label var pts			"Political Terror Scale Index (1 - 5, 1 = low)"
label var corruption	"ICRG Corruption Index (0 - 6, 0 = no or low corr)"
label var population	"Population Count"
label var gfcf			"Gross Fixed Capital Formation to GDP"
label var ussanctions 	"US Sanctions (1 if US treasury imposed sanctions)"
label var gdpgrowth 	"GDP growth (rate of growth of GDP)"
label var fdi		 	"Inward FDI (in millions)"
label var oecd_fdi		"Total Outward FDI of Selected OECD Nations"
						/* US, UK, Austria, Canada, Denmark, France, Germany,
							Japan, Netherland, Sweden, Switzerland, Ireland,
								Italy, Spain & Australia */
label var nytreport		"New York Times Naming and Shaming"
label var lnpcgdp		"Per Capita GDP (log)"
label var lnpopulation	"Population (log)"
label var lnfdi			"FDI (log)"
label var lnoecd_fdi	"Total Outward FDI of Selected OECD Nations (log)"
label var lnfdi1		"FDI inflows (log) without outliers"


**************************** Descriptive statistics ****************************

sum (lnfdi unchrcondem c2 c3 c4 c5 pts pts5 pts4 pts3 pts2 lnpcgdp polity lnpopulation crisis gdpgrowth lnelec lntrade conflict lnnytreport)




correlate lnfdi lnpcgdp gdpgrowth rentsgdp, covariance

graph matrix lnfdi lnpcgdp gdpgrowth rentsgdp

graph matrix lnfdi lnpcgdp gdpgrowth rentsgdp, half

graph matrix lnfdi lnpcgdp gdpgrowth rentsgdp, half ms(Oh)

graph matrix lnfdi lnpcgdp gdpgrowth rentsgdp, half ms(p)



pwcorr lnfdi lnpcgdp gdpgrowth rentsgdp, obs sig

pwcorr lnfdi lnpcgdp gdpgrowth rentsgdp, sig

pwcorr lnfdi lnpcgdp gdpgrowth rentsgdp, print(.1) star(.1)



histogram gfcf

histogram gfcf, frequency

histogram gfcf, normal

histogram lnfdi, by(unchrcondem)




kdensity lnfdi,

kdensity lnfdi, bwidth(10)

kdensity lnfdi, normal


*** Graphs:


graph box pts, over(unchrcondem) 

graph box pts polity, over(unchrcondem)

graph hbox lnfdi, over(unchrcondem) 


spikeplot pts



********************************************************************************
**************************** FIGURES *******************************************
********************************************************************************

**** FIGURE 1 - Evolution of FDI inflows & UNHRCC condemnations  [in another STATA file] ****

* preserve

* collapse (mean) fdi unchrcondem, by(year)

* twoway bar fdi year, yaxis(2) || line unchrcondem year, yaxis(1)

* restore



**** CREATING IVs:

egen sumpts =  sum(pts), by(year)
gen bottom = sumpts-pts
gen pts_sam = bottom/164
drop sumpts bottom


**** CREATING PTS dummies:

g pts1=1 if pts>0.5 & pts<1.5 & pts~=.
replace pts1=0 if pts1~=1 & pts~=.

g pts2=1 if pts>1.5 & pts<2.5 & pts~=.
replace pts2=0 if pts2~=1 & pts~=.

g pts3=1 if pts>2.5 & pts<3.5 & pts~=.
replace pts3=0 if pts3~=1 & pts~=.

g pts4=1 if pts>3.5 & pts<4.5 & pts~=.
replace pts4=0 if pts4~=1 & pts~=.

g pts5=1 if pts>4 & pts~=.
replace pts5=0 if pts5~=1 & pts~=.


**** CREATING UNCHR condemnations dummies:

g c1=1 if unchrrank<1 & unchrrank~=.
replace c1=0 if c1~=1 & unchrrank~=.

g c2=1 if unchrrank>0 & unchrrank<2 & unchrrank~=.
replace c2=0 if c2~=1 & unchrrank~=.

g c3=1 if unchrrank>1 & unchrrank<3 & unchrrank~=.
replace c3=0 if c3~=1 & unchrrank~=.

g c4=1 if unchrrank>2 & unchrrank<4 & unchrrank~=.
replace c4=0 if c4~=1 & unchrrank~=.

g c5=1 if unchrrank>3 & unchrrank~=.
replace c5=0 if c5~=1 & unchrrank~=.



********************************************************************************
********************** Table 1 (UNCHR condemnations & PTS) *********************
********************************************************************************

* Column 1

xi: reg lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
tab country if e(sample)==1
estimates store t1
outreg2 using "t1", excel

* Column 2

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t1", excel

* Column 3

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t1", excel

* Column 4

xi: reg lnfdi l.unchrcondem l.pts l.lngovnonpos l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t1", excel

* Column 5

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t1", excel

* Column 6

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t1", excel

* Column 7

xi: reg lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lngovnonpos l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t1", excel


**************************************************************************************
********************** Table 2 (UNCHR condemnations & Disaggregated PTS) *************
**************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
tab country if e(sample)==1
estimates store t2
outreg2 using "t2", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t2", excel

* Column 3

xi: reg lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lngovnonpos l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t2", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t2", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t2", excel

* Column 6

xi: reg lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lngovnonpos l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t2", excel


********************************************************************************
************************ Table 3 (Interaction models) **************************
********************************************************************************

* Column 1 [Interaction with UNHR condemnations]

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store t3
outreg2 using "t3", excel

* Column 2 [Interaction with UNHR condemnations & LDV]

xi: reg lnfdi l.lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t3", excel

* Column 3 [Interaction with UNHR condemnations: NYT<60 reports]

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t3", excel

* Column 4 [Interaction with UNHR condemnations & LDV: NYT<60 reports]

xi: reg lnfdi l.lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "t3", excel


******************************************************************************************************************************************************************************
**************************** Marginal Effects: FIGURE 2 & 3 (UNHR condemnations, New York Times Reporting and Marginal Effects on FDI inflows (log)) *************************
******************************************************************************************************************************************************************************

******************** FIGURE 2

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
margins, dydx(l.unchrcondem) at(l.lnnytreport=(0 (1) 6)(mean)_all) post
marginsplot, level(90) recast(line)


* xi: reg lnfdi l.lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
* margins, dydx(l.unchrcondem) at(l.lnnytreport=(0 (1) 6)(mean)_all) post
* marginsplot, level(90) recast(line)

******************* FIGURE 3

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
margins, dydx(l.unchrcondem) at(l.nytreport60=(0 (10) 60)(mean)_all) post
marginsplot, level(90) recast(line)

* xi: reg lnfdi l.lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
* margins, dydx(l.unchrcondem) at(l.nytreport60=(0 (10) 60)(mean)_all) post
* marginsplot, level(90) recast(line)


***********************************************************************************  ROBUSTNESS CHECKS  ************************************************************************************8


******************************************************************************************************************
********************** Robustness check 1A: (UNCHR condemnations & PTS: Additional Controls) *********************
******************************************************************************************************************

* Column 1

xi: reg lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
estimates store r1
outreg2 using "r1", excel

* Column 2

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1", excel

* Column 3

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1", excel

* Column 4

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.law_order l.le_all l.rents_gdp l.iccpr i.id, robust
outreg2 using "r1", excel

* Column 5

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1", excel

* Column 6

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1", excel

* Column 7

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.law_order l.le_all l.rents_gdp l.iccpr i.id, robust
outreg2 using "r1", excel


*********************************************************************************************************************************
********************** Robustness check 1B (UNCHR condemnations & Disaggregated PTS: : Additional Controls) *********************
*********************************************************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
estimates store r1b
outreg2 using "r1b", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1b", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.law_order l.le_all l.rents_gdp l.iccpr i.id, robust
outreg2 using "r1b", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1b", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1b", excel

* Column 6

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.law_order l.le_all l.rents_gdp l.iccpr i.id, robust
outreg2 using "r1b", excel


***********************************************************************************************************************
************************ Robustness check 1C: ADDITIONAL CONTROL VARIABLES (Interaction models) ***********************
***********************************************************************************************************************

* Column 1 [Interaction with UNHR condemnations]

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
estimates store r1c
outreg2 using "r1c", excel

* Column 2 [Interaction with UNHR condemnations & LDV]

xi: reg lnfdi l.lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1c", excel

* Column 3 [Interaction with UNHR condemnations: NYT<60 reports]

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1c", excel

* Column 4 [Interaction with UNHR condemnations & LDV: NYT<60 reports]

xi: reg lnfdi l.lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
outreg2 using "r1c", excel


**************************** Marginal Effects *************************

********************

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
margins, dydx(l.unchrcondem) at(l.lnnytreport=(0 (1) 6)(mean)_all) post
marginsplot, level(90) recast(line)


*******************

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.law_order l.le_all l.rents_gdp l.iccpr i.year i.id, robust
margins, dydx(l.unchrcondem) at(l.nytreport60=(0 (10) 60)(mean)_all) post
marginsplot, level(90) recast(line)


********************************************************************************
********************** Robustness check 2A: Outliers removed ********************
********************************************************************************

* Column 1

xi: reg lnfdi1 l.lnfdi1 l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store r2a
outreg2 using "r2a", excel

* Column 2

xi: reg lnfdi1 l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2a", excel

* Column 3

xi: reg lnfdi1 l.lnfdi1 l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r2a", excel

* Column 4

xi: reg lnfdi1 l.lnfdi1 l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2a", excel

* Column 5

xi: reg lnfdi1 l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2a", excel

* Column 6

xi: reg lnfdi1 l.lnfdi1 l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r2a", excel


*********************************************************************************
******************** Robustness check 2B: Outliers removed **********************
*********************************************************************************

* Column 1

xi: reg lnfdi1 l.lnfdi1 l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store r2b
outreg2 using "r2b", excel

* Column 2

xi: reg lnfdi1 l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2b", excel

* Column 3

xi: reg lnfdi1 l.lnfdi1 l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r2b", excel

* Column 4

xi: reg lnfdi1 l.lnfdi1 l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2b", excel

* Column 5

xi: reg lnfdi1 l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2b", excel

* Column 6

xi: reg lnfdi1 l.lnfdi1 l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r2b", excel

*********************************************************************************
******************** Robustness check 2C: Outliers removed **********************
*********************************************************************************

* Column 1 [Interaction with UNHR condemnations]

xi: reg lnfdi1 c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store r2c
outreg2 using "r2c", excel
margins, dydx(l.unchrcondem) at(l.lnnytreport=(0 (1) 6)(mean)_all) post


* Column 2 [Interaction with UNHR condemnations]

xi: reg lnfdi1 c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r2c", excel
margins, dydx(l.unchrcondem) at(l.nytreport60=(0 (10) 60)(mean)_all) post


********************************************************************************
******************** Robustness check 3: Alternative UNHRCC variable ***********
********************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrrank l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store r3
outreg2 using "r3", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrrank l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r3", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrrank l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r3", excel

* Column 4

xi: reg lnfdi l.lnfdi l.unchrrank l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r3", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.unchrrank l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r3", excel

* Column 6

xi: reg lnfdi l.lnfdi l.unchrrank l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.year i.id, robust
outreg2 using "r3", excel

* Column 7

xi: reg lnfdi c.l.lnnytreport##c.l.unchrrank l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r3", excel
margins, dydx(l.unchrrank) at(l.lnnytreport=(0 (1) 6)(mean)_all) post

* Column 8

xi: reg lnfdi c.l.nytreport60##c.l.unchrrank l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r3", excel
margins, dydx(l.unchrrank) at(l.nytreport=(0 (10) 60)(mean)_all) post


********************************************************************************
********************* Robustness check 4A: POST-COLD WAR PERIOD SAMPLE *********
********************************************************************************

* Column 1

xi: reg lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
estimates store r4a
outreg2 using "t4a", excel

* Column 2

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4a", excel

* Column 3

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4a", excel

* Column 4

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>1989, robust
outreg2 using "t4a", excel

* Column 5

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4a", excel

* Column 6

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4a", excel

* Column 7

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>1989, robust
outreg2 using "t4a", excel


**************************************************************************************
********************** Robustness check 4B: POST-COLD WAR PERIOD SAMPLE) *************
**************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
estimates store r4b
outreg2 using "t4b", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4b", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>1989, robust
outreg2 using "t4b", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4b", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4b", excel

* Column 6

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>1989, robust
outreg2 using "t4b", excel


***************************************************************************************************************************
************************ Robustness check 4C: POST-COLD WAR PERIOD SAMPLE - (Interaction models) **************************
***************************************************************************************************************************

* Column 1 [Interaction with UNHR condemnations]

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
estimates store r4c
outreg2 using "t4c", excel

* Column 2 [Interaction with UNHR condemnations & LDV]

xi: reg lnfdi l.lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4c", excel

* Column 3 [Interaction with UNHR condemnations: NYT<60 reports]

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4c", excel

* Column 4 [Interaction with UNHR condemnations & LDV: NYT<60 reports]

xi: reg lnfdi l.lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
outreg2 using "t4c", excel


**************************** Marginal Effects:  *************************


xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
margins, dydx(l.unchrcondem) at(l.lnnytreport=(0 (1) 6)(mean)_all) post
marginsplot, level(90) recast(line)


******************* 

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>1989, robust
margins, dydx(l.unchrcondem) at(l.nytreport60=(0 (10) 60)(mean)_all) post
marginsplot, level(90) recast(line)


********************************************************************************
******************* Robustness check 5A: POST-UNHR COUNCIL PERIOD SAMPLE *******
********************************************************************************

* Column 1

xi: reg lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
estimates store r5a
outreg2 using "t5a", excel

* Column 2

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5a", excel

* Column 3

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5a", excel

* Column 4

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>2005, robust
outreg2 using "t5a", excel

* Column 5

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5a", excel

* Column 6

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5a", excel

* Column 7

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>2005, robust
outreg2 using "t5a", excel


*****************************************************************************************
********************** Robustness check 5B: POST-UNHR COUNCIL PERIOD SAMPLE *************
*****************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
estimates store r5b
outreg2 using "t5b", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5b", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>2005, robust
outreg2 using "t5b", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5b", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id if year>2005, robust
outreg2 using "t5b", excel

* Column 6

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id if year>2005, robust
outreg2 using "t5b", excel


********************************************************************************
******************* Robustness check 6A: CONTROLLING FOR NGOs/IGOs *************
********************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
estimates store r6a
outreg2 using "r6a", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6a", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.lnngo_all i.id, robust
outreg2 using "r6a", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6a", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6a", excel

* Column 6

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.lnngo_all i.id, robust
outreg2 using "r6a", excel


**************************************************************************************
********************** Robustness check 6B: CONTROLLING FOR NGOs/IGOs ****************
**************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
estimates store r6b
outreg2 using "r6b", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6b", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.lnngo_all i.id, robust
outreg2 using "r6b", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6b", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6b", excel

* Column 6

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi l.lnngo_all i.id, robust
outreg2 using "r6b", excel


***********************************************************************************************************************
************************ Robustness check 6C: CONTROLLING FOR NGOs/IGOs (Interaction models) **************************
***********************************************************************************************************************

* Column 1 [Interaction with UNHR condemnations]

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
estimates store r6c
outreg2 using "r6c", excel

* Column 2 [Interaction with UNHR condemnations & LDV]

xi: reg lnfdi l.lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6c", excel

* Column 3 [Interaction with UNHR condemnations: NYT<60 reports]

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6c", excel

* Column 4 [Interaction with UNHR condemnations & LDV: NYT<60 reports]

xi: reg lnfdi l.lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
outreg2 using "r6c", excel


**************************** Marginal Effects *************************

********************

xi: reg lnfdi c.l.lnnytreport##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
margins, dydx(l.unchrcondem) at(l.lnnytreport=(0 (1) 6)(mean)_all) post
marginsplot, level(90) recast(line)


*******************

xi: reg lnfdi c.l.nytreport60##c.l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict l.lnngo_all i.year i.id, robust
margins, dydx(l.unchrcondem) at(l.nytreport60=(0 (10) 60)(mean)_all) post
marginsplot, level(90) recast(line)


*********************************************************************************
******************* Robustness check 7: TREATMENT REGRESSION ANALYSIS ***********
*********************************************************************************

* Column 1
xi: etreg lnfdi l.lnfdi l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, treat(l.unchrcondem = l.unchrtarget l2.pts l2.lnpcgdp l2.polity l2.lntrade l2.conflict membership l2.iccpr i.year) twostep
estimates store r7
outreg2 using "r7", excel

* Column 2

xi: etreg lnfdi l.lnfdistock l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, treat(l.unchrcondem = l.unchrtarget l2.pts l2.lnpcgdp l2.polity l2.lntrade l2.conflict membership l2.iccpr i.year) twostep
outreg2 using "r7", excel

* Column 3

xi: etreg lnfdi l.lnfdi l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, treat(l.unchrcondem = l.unchrtarget l2.pts l2.lnpcgdp l2.polity l2.lntrade l2.conflict membership l2.iccpr i.year) twostep
outreg2 using "r7", excel

* Column 4

xi: etreg lnfdi l.lnfdi l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, treat(l.unchrcondem = l.unchrtarget l2.pts l2.lnpcgdp l2.polity l2.lntrade l2.conflict membership l2.iccpr i.year) twostep
outreg2 using "r7", excel

* Column 2

xi: etreg lnfdi l.lnfdistock l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, treat(l.unchrcondem = l.unchrtarget l2.pts l2.lnpcgdp l2.polity l2.lntrade l2.conflict membership l2.iccpr i.year) twostep
outreg2 using "r7", excel

* Column 3

xi: etreg lnfdi l.lnfdi l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, treat(l.unchrcondem = l.unchrtarget l2.pts l2.lnpcgdp l2.polity l2.lntrade l2.conflict membership l2.iccpr i.year) twostep
outreg2 using "r7", excel


***********************************************************************************************
*********************** Robustness check 8A: (Controlling for GLOBAL FDI FLOWS) ***************
***********************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
estimates store r8
outreg2 using "t8", excel

* Column 2

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "t8", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "t8", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "t8", excel


************************************************************************************************************************
********************** Robustness check 9A: (UNCHR condemnations & PTS - Freedom House Democracy) *********************
************************************************************************************************************************

* Column 1

xi: reg lnfdi l.unchrcondem l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store r9
outreg2 using "r9", excel

* Column 2

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9", excel

* Column 3

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9", excel

* Column 4

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r9", excel

* Column 5

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9", excel

* Column 6

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9", excel

* Column 7

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r9", excel


*************************************************************************************************************************************
********************** Robustness check 9B (UNCHR condemnations & Disaggregated PTS - Freedom House Democracy) *********************
*************************************************************************************************************************************

* Column 1

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
estimates store r9b
outreg2 using "r9b", excel

* Column 2

xi: reg lnfdi l.lnfdistock l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9b", excel

* Column 3

xi: reg lnfdi l.lnfdi l.unchrcondem l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r9b", excel

* Column 4

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9b", excel

* Column 5

xi: reg lnfdi l.lnfdistock l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r9b", excel

* Column 6

xi: reg lnfdi l.lnfdi l.c2 l.c3 l.c4 l.c5 l.pts5 l.pts4 l.pts3 l.pts2 l.lnpcgdp l.fh_dem l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict lngfdi i.id, robust
outreg2 using "r9b", excel


********************************************************************************
*********************** Robustness check 10: (IV Models of PTS) ****************
********************************************************************************

* Column 1 [IV model basic]

xi: ivreg2 lnfdi i.year i.id (l.pts = l2.pts_sample l2.pts_iv), small ffirst
estimates store r10
outreg2 using "r10", excel

* Column 2 [IV model with LDV]

xi: ivreg2 lnfdi l.lnfdi i.year i.id (l.pts = l2.pts_sample l2.pts_iv), small ffirst
outreg2 using "r10", excel

* Column 3 [IV model with all controls]

xi: ivreg2 lnfdi l.lnfdi l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id (l.pts = l2.pts_sample l2.pts_iv), small ffirst
outreg2 using "r10", excel


******************** FIRST STEP REGRESSION OF IV ESTIMATIONS (APPENDIX) ***********************

* Column 1 [First step - IV model: No controls]

xi: reg pts l2.pts_sample l2.pts_iv i.year i.id, robust
estimates store r10a
outreg2 using "r10a", excel

* Column 2 [First step - IV model: All controls]

xi: reg pts l2.pts_sample l2.pts_iv l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r10a", excel


******************** REDUCED FORM MODEL (TESTING "EXCLUSION RESTRICTION" OF INSTRUMENTS) ***********************

* Column 1 (basic model)

xi: reg lnfdi l.lnfdi l.pts l2.pts_sample l2.pts_iv  i.year i.id, robust
estimates store r10b
outreg2 using "r10b", excel

* Column 2 (all controls)

xi: reg lnfdi l.lnfdi l.pts l2.pts_sample l2.pts_iv l.lnpcgdp l.polity l.lnpopulation l.crisis l.gdpgrowth l.lnelec l.lntrade l.conflict i.year i.id, robust
outreg2 using "r10b", excel


